		TITLE	REALIA	 -

		INCLUDE	MACROS

;
;RCL$SR		;STOP RUN SYMBOL
;	OR
;RASMACRO_START
;	OR
;RASMACRO_TABLE
;
;CODE:RCLEP_TEXT	SEGMENT
;
;RCL_GROUP	;CODE GROUP AT FRONT
;

		PUBLIC	PERFORM_VERIFY

		.DATA

	SOFT	EXTW	SYMBOL_LENGTH

	SOFT	EXTCA	OPTI_MOVE

		.CODE	MIDDLE_TEXT

	SOFT	EXTP	FAR_INSTALL,SEARCH_RAINBOW_AXBX,ERR_ABORT,AX_MESOUT

	SOFT	EXTA	CANNOT_LINK_ERR

		ASSUME	DS:NOTHING

PERFORM_VERIFY	PROC
		;
		;LOOK FOR SEGMENTS AND SYMBOLS
		;
		CALL	VERIFY_SEGMENT
		LEA	SI,@_RCL$SR
		CALL	TEST_SYMBOL
		JC	8$
		LEA	SI,@_RASMACRO_START
		CALL	TEST_SYMBOL
		JC	8$
		LEA	SI,@_RASMACRO_TABLE
		CALL	VERIFY_SYMBOL
8$:
		LEA	SI,@_RCL_GROUP
		CALL	VERIFY_GROUP
		RET

PERFORM_VERIFY	ENDP

VERIFY_SEGMENT	PROC	NEAR
		;
		;
		;
		LEA	SI,CLASS1
		CALL	VERIFY_CLASS
		MOV	DS,AX
		SYM_CONV_DS
		PUSH	[BX]._C_CLASS_NUMBER
if	fg_os2
		PUSH	SS
else
		PUSH	CS
endif
		POP	DS
		LEA	SI,SEG1
		CALL	UNXOR
		FIXES
		GET_NAME_HASH
		LNAME_INSTALL
		POP	CX
		ADD	CX,RECTYP_SEGMENT
		CALL	SEARCH_RAINBOW_AXBX
		JC	VERIFY_FAIL
		RET

VERIFY_SEGMENT	ENDP

VERIFY_CLASS	PROC	NEAR
		;
		;
		;
if	fg_os2
		PUSH	SS
else
		PUSH	CS
endif
		POP	DS
		CALL	UNXOR
		FIXES
		GET_NAME_HASH
		LNAME_INSTALL
		MOV	CX,RECTYP_CLASS
		CALL	SEARCH_RAINBOW_AXBX
		JC	VERIFY_FAIL
		RET

VERIFY_CLASS	ENDP

VERIFY_FAIL:
		MOV	AX,SEG CALL_SLR
		MOV	SI,OFF CALL_SLR
		CALL	AX_MESOUT
		MOV	CL,CANNOT_LINK_ERR
		CALL	ERR_ABORT

VERIFY_SYMBOL	PROC	NEAR
		;
		;
		;
		CALL	TEST_SYMBOL

		JNC	VERIFY_FAIL
		RET

VERIFY_SYMBOL	ENDP

TEST_SYMBOL	PROC
		;
		;
		;
if	fg_os2
		PUSH	SS
else
		PUSH	CS
endif
		POP	DS
		CALL	UNXOR
		FIXES
		GET_NAME_HASH
		CALL	FAR_INSTALL
		RET

TEST_SYMBOL	ENDP

VERIFY_GROUP	PROC	NEAR
		;
		;
		;
if	fg_os2
		PUSH	SS
else
		PUSH	CS
endif
		POP	DS
		CALL	UNXOR
		FIXES
		GET_NAME_HASH
		LNAME_INSTALL
		MOV	CX,RECTYP_GROUP
		CALL	SEARCH_RAINBOW_AXBX
		JC	VERIFY_FAIL
		RET

VERIFY_GROUP	ENDP

UNXOR		PROC	NEAR
		;
		;
		;
		PUSH	SI
		MOV	AH,0AAH
		XOR	BPTR [SI],AH
		LODSB
		MOV	CL,AL
		XOR	CH,CH
1$:
		XOR	BPTR [SI],AH
		INC	SI
		LOOP	1$
		POP	SI
		RET

UNXOR		ENDP

GENSTRING	MACRO	XX
		LOCAL	LEN

@_&XX		DB	LEN XOR 0AAH
		IRPC	XXX,<XX>
		DB	'&XXX' XOR 0AAH
		ENDM

LEN		EQU	$-1-@_&XX

		ENDM

if	fg_os2

		.DATA

endif

		GENSTRING	RCL$SR
		GENSTRING	RASMACRO_START
		GENSTRING	RASMACRO_TABLE
		GENSTRING	RCL_GROUP
CLASS1		LABEL	BYTE
		GENSTRING	<CODE>
SEG1		LABEL	BYTE
		GENSTRING	RCLEP_TEXT

if	fg_os2

		.CODE	MIDDLE_TEXT

endif

CALL_SLR	DB	LENGTH CALL_SLR-1,'Cannot link with this version of OPTLINK.',0dh,0ah,\
'Contact SLR Systems, Inc at (412)282-0864 for other OPTLINK versions.',0dh,0ah, \
'Or write:',0dh,0ah, \
'  1622 N. Main St.',0dh,0ah, \
'  Butler, PA  16001',0dh,0ah

		END

